﻿using CS795.TravelAgency.Domain.Entities;
using CS795.TravelAgency.Domain.Entities.Configurations;
using System.Data.Entity;

namespace CS795.TravelAgency.Domain
{
    public class TravelAgencyContext : DbContext
    {
        public DbSet<CarRentalReservation> CarRentalReservations { get; set; }
        public DbSet<FlightReservation> FlightReservations { get; set; }
        public DbSet<HotelReservation> HotelReservations { get; set; }
        public DbSet<Role> Roles { get; set; }
        public DbSet<Trip> Trips { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Vendor> Vendors { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new CarRentalReservationConfiguration());
            modelBuilder.Configurations.Add(new FlightReservationConfiguration());
            modelBuilder.Configurations.Add(new HotelReservationConfiguration());
            modelBuilder.Configurations.Add(new RoleConfiguration());
            modelBuilder.Configurations.Add(new TripConfiguration());
            modelBuilder.Configurations.Add(new UserConfiguration());
            modelBuilder.Configurations.Add(new VendorConfiguration());
        }
    }
}
